home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 1 / Cream of the Crop 1.iso / PRINTER / JPSRC11.ARJ / JETUTIL.H < prev    next >
C/C++ Source or Header  |  1991-08-03  |  4KB  |  87 lines

  1. /*
  2.  *      JET PAK - HP DeskJet and LaserJet series printer utilities
  3.  *
  4.  *      JETUTIL header - miscellaneous utility definitions
  5.  *
  6.  *      Version 1.1 (Public Domain)
  7.  */
  8.  
  9. /* useful definitions */
  10. #define sizeofarray(a) (sizeof(a)/sizeof(a[0]))
  11. #define FALSE 0
  12. #define TRUE !FALSE
  13.  
  14. /* returns from functions (EOF is picked up from <stdio.h>) */
  15. #define OK      0
  16. #define ERROR   -2
  17.  
  18. /* general messages */
  19. #define ERROR_NO_FILES_MATCHED  "ERROR: no files found matching \"%s\"\n"
  20. #define ERROR_OPTION_BAD        "ERROR: option -%c unrecognised\n"
  21. #define ERROR_OPTION_NO_ARG     "ERROR: option -%c requires an argument\n"
  22. #define ERROR_OUT_OF_HEAP       "ERROR: not enough heap to process arguments\n"
  23.  
  24. /* messages relating to processing of a particular file */
  25. #define ERROR_BITMAP_TOO_BIG    "%s%s: ERROR: bitmap too big to handle\n"
  26. #define ERROR_CODE_TOO_BIG      "%s%s: ERROR: character code %d too big to handle\n"
  27. #define ERROR_CONTINUATION      "%s%s: ERROR: font contains continuation data\n"
  28. #define ERROR_DATA_MISSING      "%s%s: ERROR: missing data at line %d\n"
  29. #define ERROR_DESKJET           "%s%s: ERROR: input file is already in DeskJet format\n"
  30. #define ERROR_FILE_READ_FAILED  "%s%s: ERROR: problem reading input file\n"
  31. #define ERROR_FILE_WRITE_FAILED "%s%s: ERROR: problem writing output file\n"
  32. #define ERROR_FONT_OUT_OF_HEAP  "%s%s: ERROR: not enough heap to process font\n"
  33. #define ERROR_FONT_TOO_BIG      "%s%s: ERROR: font too big to handle\n"
  34. #define ERROR_KEYWORD_MISSING   "%s%s: ERROR: missing keyword at line %d\n"
  35. #define ERROR_LANDSCAPE_FIXED   "%s%s: ERROR: only fixed width landscape fonts convertible\n"
  36. #define ERROR_LASERJET          "%s%s: ERROR: input file is already in LaserJet format\n"
  37. #define ERROR_OPEN_READ_FAILED  "%s%s: ERROR: can't open for reading\n"
  38. #define ERROR_OPEN_WRITE_FAILED "%s%s: ERROR: can't open \"%s\" for writing\n"
  39. #define ERROR_OVERWRITE         "%s%s: ERROR: output file will overwrite input file\n"
  40. #define WARNING_BAD_FONT_FORMAT "%s%s: WARNING: unrecognised font format %d\n"
  41. #define WARNING_BAD_CHAR_FORMAT "%s%s: WARNING: unrecognised character format %d\n"
  42. #define WARNING_COMMAND_SKIPPED "%s%s: WARNING: skipping ESC %s %d %s\n"
  43. #define WARNING_DJ_LANDSCAPE    "%s%s: WARNING: landscape font unusable on original Deskjet\n"
  44. #define WARNING_DJ_TOO_LARGE    "%s%s: WARNING: output font too large for original Deskjet\n"
  45. #define WARNING_DJ500_ONLY      "%s%s: WARNING: output font can only be used on the DeskJet 500\n"
  46. #define WARNING_SIDE_BEARING    "%s%s: WARNING: %s negative side bearing lost (%d for %s worst)\n"
  47. #define WARNING_STRING_NL       "%s%s: WARNING: string not terminated at end of line %d\n"
  48. #define WARNING_TOKEN_OVERFLOW  "%s%s: WARNING: token overflow at line %d\n"
  49.  
  50. /* comfort messages when there are no errors */
  51. #define OK_JETDMP   "%s%s: dump file \"%s\" generated OK\n"
  52. #define OK_JETL2D   "%s%s: DJ soft font file \"%s\" generated OK\n"
  53. #define OK_JETD2L   "%s%s: LJ soft font file \"%s\" generated OK\n"
  54. #define OK_JETPRD   "%s%s: printer description file \"%s\" generated OK\n"
  55. #define OK_JETPRINT "%s%s: output sent to printer\n"
  56. #define OK_JETRST   "%s%s: soft font file \"%s\" restored OK\n"
  57.  
  58. /* these string are appended to the soft font header comment as JETPAK
  59.    signatures */
  60. #define JETL2D_COMMENT_SUFFIX " (JETL2D conversion) "
  61. #define JETD2L_COMMENT_SUFFIX " (JETD2L conversion) "
  62.  
  63. /* maximum length of user defined output file suffix */
  64. #define SUFFIX_MAX  32
  65.  
  66. /* definitions for option processing utility functions */
  67. extern char *optarg;
  68. extern int optind, opterr;
  69. extern int getopt();
  70.  
  71. /* definitions for directory search utility functions; os_getfile() sets
  72.    os_file and os_dir to point to the next matching file to be processed */
  73. #define OS_DIR_LEN 256
  74. #define OS_FILE_LEN 64
  75. #define OS_PATH_LEN (OS_DIR_LEN + OS_FILE_LEN - 1)
  76. extern char *os_dir;
  77. extern char *os_file;
  78. extern int os_findfiles();
  79. extern int os_getfile();
  80.  
  81. /* definitions for printing utility functions */
  82. extern void os_printbuf();
  83. extern void os_printstr();
  84.  
  85. /* definitions for memory allocation functions */
  86. extern void *zalloc();
  87.